package com.iteleven.generator.json;

import com.iteleven.generator.common.KafkaMsgSend;

import java.util.HashMap;
import java.util.Set;

public class AultonIotRecord {

    public static void main(String[] args) {

        final HashMap<String, String> topicAndMessages = new HashMap<String, String>();
        // 国标
        topicAndMessages.put("iot-vehicle-32960-vehicle-login", "{\"head\":{\"messageType\":\"002\",\"protocolType\":\"GBT32960\",\"deviceId\":\"71B8240ED3B04824A\",\"dtoName\":\"com.aulton.ms.iot.common.model.dto.model.vehicle.nationalstandard.VehicleLoginInfoDto\",\"pushTime\":\"2022-08-31 09:56:35\"},\"data\":{\"headId\":1014473772108873728,\"dataAchieveTime\":1661910994273,\"loginId\":18960,\"iccId\":\"f913f1f61bfe47efb4b5\",\"rechargeableCount\":56,\"rechargeableLength\":7,\"rechargeableCode\":\"z7q4gmO,LcNdXX0,xVJgUcf,LPDcp8h,eBonnBo,tnUMST3,gRruBUl,6XmSoY0,JEPVTRt,m3PtcJe,hORqEXF,v3Nq8Sc,BrfefwE,jD46N0y,QvBLoBZ,y8XiMPj,j7mLdHO,FcHOxgB,KsuYHOA,0mkWePJ,PoWrntr,loSPsNj,bGXYH1G,aPQxjlf,oMdSMf5,26GgisV,69vig3A,SAArApB,eENRzSL,acKtarz,RCKGkVg,EoTh4J7,hm7K5IP,F6qpJ4t,QHn1dii,xW6XmDT,ZrByjuU,BRVHdFu,HQ2InM7,BiCOb6l,udBWbzN,msJe07O,M82GcPI,xPr77VC,QQh93fy,0m1CJtV,cDetzHB,4Cmo11R,knTgAyU,pPZTCDK,o0EYO9P,1m8vdiL,xp7camy,viTGKRT,J0wX6em,LLfiyFB\"}}");
        topicAndMessages.put("iot-vehicle-32960-vehicle-logout", "{\"head\":{\"messageType\":\"002\",\"protocolType\":\"GBT32960\",\"deviceId\":\"393DF5EE52D64127A\",\"dtoName\":\"com.aulton.ms.iot.common.model.dto.model.vehicle.nationalstandard.VehicleLogoutInfoDto\",\"pushTime\":\"2022-08-31 09:35:03\"},\"data\":{\"headId\":1014468354863267840,\"logoutTime\":1661909703708,\"logoutId\":4}}");
        topicAndMessages.put("iot-vehicle-32960-realtime-vehicle", "{\"head\":{\"messageType\":\"002\",\"protocolType\":\"GBT32960\",\"deviceId\":\"CCCCCCCCCCCCCCCCC\",\"dtoName\":\"com.aulton.ms.iot.common.model.dto.model.vehicle.nationalstandard.realtime.RealtimeInfoVehicleInfoDto\",\"pushTime\":\"2022-08-30 17:11:33\"},\"data\":{\"headId\":1014220847176482816,\"readIndex\":49,\"dataUnitLength\":27,\"dataAchieveTime\":1661850693278,\"carStatus\":4,\"chargeStatus\":3,\"runMode\":0,\"totalVoltage\":450.5,\"totalCurrent\":-477.6,\"dcdcStatus\":2,\"gear\":9,\"resistance\":4703,\"extend1\":0,\"speed\":177.4,\"odo\":159950.0,\"soc\":26}}");
        topicAndMessages.put("iot-vehicle-32960-realtime-position", "{\"head\":{\"messageType\":\"002\",\"protocolType\":\"GBT32960\",\"deviceId\":\"CCCCCCCCCCCCCCCCC\",\"dtoName\":\"com.aulton.ms.iot.common.model.dto.model.vehicle.nationalstandard.realtime.RealtimeInfoPositionInfoDto\",\"pushTime\":\"2022-08-30 17:11:33\"},\"data\":{\"headId\":1014220847239397376,\"readIndex\":59,\"dataUnitLength\":37,\"dataAchieveTime\":1661850693278,\"positionStatus\":0,\"longitude\":79.053980,\"latitude\":41.551571}}");
        topicAndMessages.put("iot-vehicle-32960-realtime-motor", "{\"head\":{\"messageType\":\"002\",\"protocolType\":\"GBT32960\",\"deviceId\":\"46FB2633529C4F788\",\"dtoName\":\"com.aulton.ms.iot.common.model.dto.model.vehicle.nationalstandard.realtime.RealtimeInfoMotorInfoDto\",\"pushTime\":\"2022-08-31 09:40:56\"},\"data\":{\"headId\":1014469835481939968,\"readIndex\":42,\"dataUnitLength\":20,\"dataAchieveTime\":1661910056715,\"motorItemList\":[{\"motorSerialNum\":250,\"motorStatus\":1,\"motorControlCutterTemp\":210,\"motorTurnSpeed\":40000,\"motorTurnTorque\":-15000.0,\"motorTemp\":88,\"motorControlVoltage\":4000.0,\"motorControlCurrent\":0.0}]}}");
        topicAndMessages.put("iot-vehicle-32960-realtime-battery", "{\"head\":{\"messageType\":\"002\",\"protocolType\":\"GBT32960\",\"deviceId\":\"ADC1A80F61934EC98\",\"dtoName\":\"com.aulton.ms.iot.common.model.dto.model.vehicle.nationalstandard.realtime.RealtimeInfoBatteryInfoDto\",\"pushTime\":\"2022-08-31 09:43:36\"},\"data\":{\"headId\":1014470506490888192,\"readIndex\":49,\"dataUnitLength\":27,\"dataAchieveTime\":1661910216694,\"batteryVoltage\":1500.0,\"batteryCurrent\":2000.0,\"fuelConsumptionRate\":500.00,\"temperatureProbesCount\":2,\"temperatureProbesTemp\":\"10,190\",\"maxTemp\":200.0,\"maxTempProbesNum\":250,\"maxConcentration\":40000,\"maxConcentrationSensorNum\":200,\"maxPressure\":100.0,\"maxPressureSensorNum\":128,\"highPressureStatus\":1}}");
        topicAndMessages.put("iot-vehicle-32960-realtime-engine", "{\"head\":{\"messageType\":\"002\",\"protocolType\":\"GBT32960\",\"deviceId\":\"0506B199BBC64F80B\",\"dtoName\":\"com.aulton.ms.iot.common.model.dto.model.vehicle.nationalstandard.realtime.RealtimeInfoEngineInfoDto\",\"pushTime\":\"2022-08-31 09:42:26\"},\"data\":{\"headId\":1014470211081863168,\"readIndex\":34,\"dataUnitLength\":12,\"dataAchieveTime\":1661910145266,\"engineStatus\":1,\"crankshaftSpeed\":60000,\"fuelConsumptionRate\":300.00}}");
        topicAndMessages.put("iot-vehicle-32960-realtime-extreme", "{\"head\":{\"messageType\":\"002\",\"protocolType\":\"GBT32960\",\"deviceId\":\"99D32E4AAB05482E8\",\"dtoName\":\"com.aulton.ms.iot.common.model.dto.model.vehicle.nationalstandard.realtime.RealtimeInfoExtremeInfoDto\",\"pushTime\":\"2022-08-31 11:03:56\"},\"data\":{\"headId\":1014490721706573824,\"readIndex\":43,\"dataUnitLength\":20,\"dataAchieveTime\":1661915035379,\"maxVolBatSubSysNum\":250,\"maxVolBatSubUnitNum\":250,\"maxCellVol\":15000,\"minVolBatSubSysNum\":250,\"minVolBatSubUnitNum\":250,\"minCellVol\":15000,\"maxTempSubSysNum\":250,\"maxTempProbeNum\":250,\"maxTemp\":210,\"minTempSubSysNum\":250,\"minTempProbeNum\":250,\"minTemp\":210}}");
        topicAndMessages.put("iot-vehicle-32960-realtime-acp-alarm", "{\"head\":{\"messageType\":\"002\",\"protocolType\":\"GBT32960\",\"deviceId\":\"4A8DF1754A614D25A\",\"dtoName\":\"com.aulton.ms.iot.common.model.dto.model.vehicle.nationalstandard.realtime.acp.RealtimeInfoAcpAlarmInfoDto\",\"pushTime\":\"2022-08-31 11:04:23\"},\"data\":{\"headId\":1014490836924104704,\"readIndex\":37,\"dataUnitLength\":15,\"dataAchieveTime\":1661915063849,\"alarmData\":\"2441140935\"}}");
        topicAndMessages.put("iot-vehicle-32960-realtime-acp-battery-management", "{\"head\":{\"messageType\":\"002\",\"protocolType\":\"GBT32960\",\"deviceId\":\"40D9D41FB121421C9\",\"dtoName\":\"com.aulton.ms.iot.common.model.dto.model.vehicle.nationalstandard.realtime.acp.RealtimeInfoAcpBatteryManagementInfoDto\",\"pushTime\":\"2022-08-31 09:46:34\"},\"data\":{\"headId\":1014471250115821568,\"readIndex\":34,\"dataUnitLength\":12,\"dataAchieveTime\":1661910393980,\"outsideStationProhibitCharging\":0,\"outsideStationMaxCurrent\":1612.75,\"remainingOutsideStationChargingAllowingTotalElectric\":6550.0}}");
        topicAndMessages.put("iot-vehicle-32960-realtime-acp-battery-statistic", "{\"head\":{\"messageType\":\"002\",\"protocolType\":\"GBT32960\",\"deviceId\":\"258CF35B0C84475EA\",\"dtoName\":\"com.aulton.ms.iot.common.model.dto.model.vehicle.nationalstandard.realtime.acp.RealtimeInfoAcpBatteryStatisticInfoDto\",\"pushTime\":\"2022-08-31 09:45:56\"},\"data\":{\"headId\":1014471091898286080,\"readIndex\":69,\"dataUnitLength\":47,\"dataAchieveTime\":1661910355263,\"batTotalOutEnergy\":4211081.0,\"theOutEnergy\":6425.5,\"batTotalInEnergy\":4211081.0,\"theInEnergy\":6425.5,\"batTotalChargeAmount\":65500,\"batTotalOutCapacity\":4211081.0,\"theOutCapacity\":6425.5,\"batTotalInCapacity\":4211081.0,\"theInCapacity\":6425.5,\"batTotalKM\":4211081.0,\"batTotalQuickChargeAmount\":65500,\"totalStationOutsideInCapacity\":4211081.0,\"totalStationOutsideInEnergy\":4211081.0}}");
        topicAndMessages.put("iot-vehicle-32960-realtime-acp-battery-status", "{\"head\":{\"messageType\":\"002\",\"protocolType\":\"GBT32960\",\"deviceId\":\"98A8B0D25E6B49CB9\",\"dtoName\":\"com.aulton.ms.iot.common.model.dto.model.vehicle.nationalstandard.realtime.acp.RealtimeInfoAcpBatteryStatusInfoDto\",\"pushTime\":\"2022-08-31 09:44:49\"},\"data\":{\"headId\":1014470812826075136,\"readIndex\":45,\"dataUnitLength\":23,\"dataAchieveTime\":1661910289732,\"batMaxAllowOutCurrent\":-1599.4,\"batMaxAllowFeedbackCurrent\":-1599.0,\"batInNetworkStatus\":1,\"relayStatus\":1,\"batBoxLockStatus\":0,\"batUseableEnergy\":6.5,\"batUseableCapacity\":0.1,\"maxAllowFeedbackPower\":3.2,\"maxAllowOutPower\":1.2,\"epbstatus\":0}}");
        topicAndMessages.put("iot-vehicle-32960-platform-login", "{\"head\":{\"messageType\":\"002\",\"protocolType\":\"GBT32960\",\"deviceId\":\"88FA0420C49D44439\",\"dtoName\":\"com.aulton.ms.iot.common.model.dto.model.vehicle.nationalstandard.PlatformLoginInfoDto\",\"pushTime\":\"2022-08-30 17:11:33\"},\"data\":{\"headId\":1014220847306506240,\"loginTime\":1661850692310,\"loginId\":8,\"userName\":\"172.16.11.25\",\"password\":\"测试连接情况..\",\"encryptionRule\":1}}");
        topicAndMessages.put("iot-vehicle-32960-platform-logout", "{\"head\":{\"messageType\":\"002\",\"protocolType\":\"GBT32960\",\"deviceId\":\"5F7ACABC9E1D47DDA\",\"dtoName\":\"com.aulton.ms.iot.common.model.dto.model.vehicle.nationalstandard.PlatformLogoutInfoDto\",\"pushTime\":\"2022-08-31 09:24:13\"},\"data\":{\"headId\":1014465626229440512,\"logoutTime\":1661909052151,\"logoutId\":10}}");

        // mqtt

        for (int i = 0; i < 1000000; i++) {
            final Set<String> topics = topicAndMessages.keySet();
            for (String topic : topics) {
                KafkaMsgSend.send("http://localhost:8889/ReportToKafkaApplication/retriveData", topic, topicAndMessages.get(topic));
                System.out.println(topicAndMessages.get(topic));
            }
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
